package com.dduggs.note.others;

/**
 * 重写方法测试
 */
public class Dervied extends Base{
    private static String name="dervied";

    public Dervied(){
        tellName();
        printName();
    }

    @Override
    public void tellName(){
        System.out.println("Dervied tell name"+name);
    }

    @Override
    public void printName(){
        System.out.println("Dervied print name"+name);
    }

    public static void main(String[] args) {
        new Dervied();
    }

}

class Base{

    private static String name="base";

    public Base(){
        tellName();
        printName();
    }

    public void tellName(){
        System.out.println("Base tell name"+name);
    }

    public void printName(){
        System.out.println("Base print name"+name);
    }
}